package com.lch.distributed.serialize;


import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author: liuchenhui
 * @create: 2019-06-02 20:10
 **/
public class Server {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ServerSocket serverSocket = new ServerSocket(8089);

        final Socket socket = serverSocket.accept();

        ObjectInputStream objectInputStream = new ObjectInputStream(socket.getInputStream());
        final User user = (User) objectInputStream.readObject();
        System.out.println(user);
    }
}
